PROJECT (conex)

FIND_PACKAGE(Qt4 REQUIRED)
#find xerces package
INCLUDE(${QT_USE_FILE})

#add the files to our groups and app
#seems to be a bug in cmake, can't put these in analysis\\standard folder :(
#upper detail

#QT4_WRAP_CPP
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

QT4_WRAP_CPP(conexide_MOCS ./conexide.h)
QT4_WRAP_UI(conexide_UIS ./conexide.ui)
QT4_WRAP_CPP(FindDialog_MOCS ./FindDialog.h)
QT4_WRAP_UI(FindDialog_UIS ./FindDialog.ui)
QT4_ADD_RESOURCES(CONEX-RCC_SRCS ./conexmain.qrc)
#QT4_WARP_UI

SET(conex_Files
	#for example 
	#./control/ControlSynset.cpp	
	./main.cc	
	./conexide.cc
	./FindDialog.cc
	./VocabularyTableModel.cc
#	./viewmodel/ModifiedTableModel.cc
#	./viewmodel/HistoryTableModel.cc
	${conexide_MOCS}
	${conexide_UIS}
	${FindDialog_MOCS}
	${FindDialog_UIS}
	${CONEX-RCC_SRCS}	
)


#find our headers
file(GLOB_RECURSE HEADERS ${conex_SOURCE_DIR}/*.h)



#create the libraries
SET(libxpm ../libxpm)
SET(libconex ../libconex)
SET(libsfa ../libsfa)
SET(libjson ../../libs/libjson-master)

INCLUDE_DIRECTORIES( ${libxpm}
                     ${libconex}
                     ${libsfa}
					 ${libjson}
					 )	

add_executable(conex
	           ${conex_Files} 
	           ${HEADERS})

FIND_PACKAGE(XERCESC REQUIRED)

TARGET_LINK_LIBRARIES(conex
                      libsfa 
                      libconex 
                      libxpm	
                      D:/Projects/libs/libjson-master/bin/release/libjson.lib					  
					  ${QT_LIBRARIES}
					  ${XERCESC_LIBRARY})
			   

#set properties on the libraries
SET_TARGET_PROPERTIES(conex PROPERTIES
    VERSION ${conexide_VERSION}
    SOVERSION ${conexide_SOVERSION}
    COMPILE_DEFINITIONS_DEBUG _DEBUG
)			

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    if(DEFINED MINGW)
		SET(CMAKE_EXE_LINKER_FLAGS "-mwindows -fopenmp")
	else(DEFINED MINGW)
#	    SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES COMPILE_FLAGS "${XPMDOC_SOURCE_DIR}/src/dal/dal/db/otlv4.h" )
#        SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES LINK_FLAGS "odbc32.lib" )
#		SET(CMAKE_CXX_FLAGS "/DGLUT_BUILDING_LIB /openmp")
		SET(CMAKE_EXE_LINKER_FLAGS "/subsystem:windows
		/entry:mainCRTStartup 
		/NODEFAULTLIB:libcmt.lib 
		/level='requireAdministrator'")
	endif(DEFINED MINGW)
else(CMAKE_SYSTEM_NAME MATCHES "Windows")
	SET(CMAKE_EXE_LINKER_FLAGS "-fopenmp")
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")		  